/************************************************************************/
/*  									*/
/*  readcdbk_MI.c							*/
/*									*/
/*  Tom Lookabaugh							*/
/*  August 14, 1987							*/
/*  Last Revision: August 15, 1987					*/
/*									*/
/*  DESCRIPTION								*/
/*	Modified Itakura version. Gets memory.				*/
/*	Reads the codebook (filter autocorrelations), then reads	*/
/*	reflection coefficients and writes them.			*/
/*  RETURNS								*/
/*	No significant value.  						*/
/*  CALLS								*/
/*	error()								*/
/*									*/
/************************************************************************/

#include "stdvq.h"

readcdbk (cdbk, cdbksz) 

    double **cdbk;	/* pointer to codebook				*/
    int cdbksz;		/* codebook size in vectors			*/
    
{
    
    if ((*cdbk = (double *)calloc(cdbksz*(2*cdbkdim - 1), sizeof(double)))
      == NULL) error("insufficient memory (readcdbk 1)");
    
    if (fread(*cdbk, sizeof(double), cdbksz*(2*cdbkdim - 1), cdbkfile) !=
      cdbksz*(2*cdbkdim - 1)) error("failed to read codebook (readcdbk 2)");
    
}

